<?php

namespace App\Jobs\test;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;

class TestJob implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    private $data;


    /**
     * Create a new job instance.
     * 测试任务
     * php artisan queue:work redis --queue=testredislist
     *
     * @return void
     */
    public function __construct($data)
    {
        $this->queue = 'testredislist';
        $this->data = $data;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        Log::channel('redislist')->info('--------------------------请求日志队列开始--------------------------');
        Log::channel('redislist')->info('队列名称:'.$this->queue);
        Log::channel('redislist')->info('队列参数:'.$this->data);
        Log::channel('redislist')->info('--------------------------请求日志队列结束--------------------------');
    }
}
